import {createRouter, createWebHashHistory} from 'vue-router'
import Main from '@/views/main.vue' 

import mainRout from './mainRout'

const routes = [
	{
		path: '/',
		redirect: '/main'
	}, {
		path: '/main',
		component: Main,
		redirect:   './main/home',
		// children: [].concat(mainRout, demoRout),   // 多模块路由   [].concat(mainRout, demoRout),
		children: [].concat(mainRout),   // 多模块路由   [].concat(mainRout, demoRout),
	// }, {
	// 	path: '/home',
	// 	name: 'home',
	// 	component: Main
	}
]
export let history = createWebHashHistory()

let router = createRouter({
	history,
	routes,
})
export const clear = () => { //卸载子应用清空历史路由
	history = null
	router = null
}
export default router;